﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Automobile.service.Model;
using Automobile.service.BLL;

namespace Automobile.service.UI
{
    public partial class AddSupplier : System.Web.UI.Page
    {
        SupplierBll bll = new SupplierBll();
        protected void Page_Load(object sender, EventArgs e)
        {


        }
        /// <summary>
        /// 返回供应商显示页面
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnBack_Click(object sender, EventArgs e)
        {
            Response.Redirect("Supplier.aspx");
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            SupplierModel s = new SupplierModel();

            s.Supplier_Name = this.TextBox1.Text;
            s.Supplier_People = this.TextBox2.Text;
            s.Supplier_Phone = this.TextBox3.Text;
            s.Supplier_Addr = this.TextBox4.Text;
            if (bll.AddSupplier(s) > 0)
            {
                Response.Write("<script>alert('添加成功!');location.href='Supplier.aspx';</script>");
            }
            else
            {
                Response.Write("<script>alert('添加失败!');</script>");
            }
        }
    }
}